﻿using System;
using System.Web.UI;
using olierFrm.WebFormDev;
using olierFrm.DataBase.FrameWork.StdQuery;
using olierFrm.WebFormDev.StdQuery;

namespace WebFormDev.Plugin
{
    public partial class DialogGridSel : System.Web.UI.Page
    {
        protected void Page_PreInit(object sender, EventArgs e)
        {
            ManageSystem.IsLogin();
            ManageSystem.SetTheme(Page);
            //没有QueryName只显示菜单，为了重复利用该页面（系统首页和StdQuery）

        }

        protected void Page_Load(object sender, EventArgs e)
        {
            //hfCallBackField.Value = Request.QueryString["CallBackField"];
            hfIsDataObject.Value = Request.QueryString["IsDataObject"];
            StdQuerySQL dbStdQuery = new StdQuerySQL(StdQuery.QueryName);
            hfCurQueryName.Value = StdQuery.QueryName;
            var controls = StdQueryParam.StdQueryParamControls(dbStdQuery.StdQueryParams);
            foreach (var c in controls)
            {
                panelStdQueryParam.Controls.Add(c);
                //try
                //{
                //    HandelControl.SetControlValue(c.Controls[0].Controls[0].Controls[0].Controls[1], Request.QueryString[c.ID.Replace("Field_", "")]);
                //}
                //catch { }
            }
            panelStdQueryParam.Controls.Add(new LiteralControl("<div style='clear:both'></div>"));


            //foreach (var p in sqs.StdQueryParams)
            //{
            //    sqs.SetParam(p.ParamName, Request.QueryString[p.ParamName]);
            //}
            //sqs.AddSystemParams();
            //var dtSource = sqs.ExecuteSQL();


        }
    }
}